Slope Field
   HOME

TheInfoList



OR:

Slope fields (also called direction fields) are a graphical representation of the solutions to a first-order
differential equation In mathematics, a differential equation is an equation that relates one or more unknown functions and their derivatives. In applications, the functions generally represent physical quantities, the derivatives represent their rates of change, an ...
of a scalar function. Solutions to a slope field are functions drawn as solid curves. A slope field shows the slope of a differential equation at certain vertical and horizontal intervals on the x-y plane, and can be used to determine the approximate tangent slope at a point on a curve, where the curve is some solution to the differential equation.


Definition


Standard case

The slope field can be defined for the following type of differential equations :y' = f(x, y), which can be interpreted geometrically as giving the
slope In mathematics, the slope or gradient of a line is a number that describes both the ''direction'' and the ''steepness'' of the line. Slope is often denoted by the letter ''m''; there is no clear answer to the question why the letter ''m'' is use ...
of the
tangent In geometry, the tangent line (or simply tangent) to a plane curve at a given point is the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points on the curve. More ...
to the
graph Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discre ...
of the differential equation's solution (''
integral curve In mathematics, an integral curve is a parametric curve that represents a specific solution to an ordinary differential equation or system of equations. Name Integral curves are known by various other names, depending on the nature and interpret ...
'') at each point (''x'', ''y'') as a function of the point coordinates. It can be viewed as a creative way to plot a real-valued function of two real variables f(x,y) as a planar picture. Specifically, for a given pair x,y, a vector with the components , f(x,y)/math> is drawn at the point x,y on the x,y-plane. Sometimes, the vector , f(x,y)/math> is normalized to make the plot better looking for a human eye. A set of pairs x,y making a rectangular grid is typically used for the drawing. An
isocline 300px, Fig. 1: Isoclines (blue), slope field (black), and some solution curves (red) of ''y = ''xy''. Given a family of curves, assumed to be differentiable, an isocline for that family is formed by the set of points at which some m ...
(a series of lines with the same slope) is often used to supplement the slope field. In an equation of the form y'=f(x,y), the isocline is a line in the x,y-plane obtained by setting f(x,y) equal to a constant.


General case of a system of differential equations

Given a system of differential equations, :\begin \frac&=f_1(t, x_1, x_2, \ldots, x_n) \\ \frac&=f_2(t, x_1, x_2, \ldots, x_n) \\ &\;\;\vdots \\ \frac&=f_n(t, x_1, x_2, \ldots, x_n) \end the slope field is an array of slope marks in the phase space (in any number of dimensions depending on the number of relevant variables; for example, two in the case of a first-order linear
ODE An ode (from grc, ᾠδή, ōdḗ) is a type of lyric poetry. Odes are elaborately structured poems praising or glorifying an event or individual, describing nature intellectually as well as emotionally. A classic ode is structured in three majo ...
, as seen to the right). Each slope mark is centered at a point (t,x_1,x_2,\ldots,x_n) and is parallel to the vector :\begin 1 \\ f_1(t,x_1,x_2,\ldots,x_n) \\ f_2(t,x_1,x_2,\ldots,x_n) \\ \vdots \\ f_n(t,x_1,x_2,\ldots,x_n) \end. The number, position, and length of the slope marks can be arbitrary. The positions are usually chosen such that the points (t,x_1,x_2,\ldots,x_n) make a uniform grid. The standard case, described above, represents n=1. The general case of the slope field for systems of differential equations is not easy to visualize for n>2.


General application

With computers, complicated slope fields can be quickly made without tedium, and so an only recently practical application is to use them merely to get the feel for what a solution should be before an explicit general solution is sought. Of course, computers can also just solve for one, if it exists. If there is no explicit general solution, computers can use slope fields (even if they aren’t shown) to numerically find graphical solutions. Examples of such routines are
Euler's method In mathematics and computational science, the Euler method (also called forward Euler method) is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. It is the most basic explicit met ...
, or better, the
Runge–Kutta methods In numerical analysis, the Runge–Kutta methods ( ) are a family of implicit and explicit iterative methods, which include the Euler method, used in temporal discretization for the approximate solutions of simultaneous nonlinear equations. The ...
.


Software for plotting slope fields

Different software packages can plot slope fields.


Direction field code in

GNU Octave GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a langu ...
/
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation ...

funn = @(x, y)y-x; % function f(x, y) = y-x
, y The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
= meshgrid(-5:0.5:5); % intervals for x and y slopes = funn(x, y); % matrix of slope values dy = slopes ./ sqrt(1 + slopes.^2); % normalize the line element... dx = ones(length(dy)) ./ sqrt(1 + slopes.^2); % ...magnitudes for dy and dx h = quiver(x, y, dx, dy, 0.5); % plot the direction field set(h, "maxheadsize", 0.1); % alter head size


Example code for Maxima

/* field for y'=xy (click on a point to get an integral curve). Plotdf requires Xmaxima */ plotdf( x*y, ,-2,2 ,-2,2;


Example code for Mathematica

(* field for y'=xy *) VectorPlot ,


Example code for

SageMath SageMath (previously Sage or SAGE, "System for Algebra and Geometry Experimentation") is a computer algebra system (CAS) with features covering many aspects of mathematics, including algebra, combinatorics, graph theory, numerical analysis, numbe ...

var('x,y') plot_slope_field(x*y, (x,-2,2), (y,-2,2))


Examples

Image:Slope_field_1.svg, Slope field Image:Slope_field_with_integral_curves_1.svg, Integral curves image:Isocline_3.png, Isoclines (blue), slope field (black), and some solution curves (red)


See also

*
Examples of differential equations In mathematics, a differential equation is an equation that relates one or more unknown functions and their derivatives. In applications, the functions generally represent physical quantities, the derivatives represent their rates of change, ...
* Vector field *
Laplace transform applied to differential equations In mathematics, the Laplace transform is a powerful integral transform used to switch a function from the time domain to the s-domain. The Laplace transform can be used in some cases to solve linear differential equations with given initial conditi ...
*
List of dynamical systems and differential equations topics This is a list of dynamical system and differential equation topics, by Wikipedia page. See also list of partial differential equation topics, list of equations. Dynamical systems, in general *Deterministic system (mathematics) *Linear system * P ...
*
Qualitative theory of differential equations In mathematics, the qualitative theory of differential equations studies the behavior of differential equations by means other than finding their solutions. It originated from the works of Henri Poincaré and Aleksandr Lyapunov. There are relatively ...


References

* Blanchard, Paul; Devaney, Robert L.; and Hall, Glen R. (2002). ''Differential Equations'' (2nd ed.). Brooks/Cole: Thompson Learning.


External links

* {{MathWorld , title = Slope field , urlname = SlopeField
Slope field plotter (Java)


Calculus Differential equations Articles with example MATLAB/Octave code Plots (graphics)